<?php

chdir('../');

require('includes/setUp.php');

try {

  Validations::validateString($_POST['eMail'], 30, Validations::regexp_EMail);     
  $result = $db->getRepository('User')->findOneBy(array('eMail' => $_POST['eMail']));

} catch (Exception $ex) {
  globalFunc::inlineStatementError(T_('Error!'));
  die;
}



if ($result == null) {
  globalFunc::inlineStatementOk(T_('OK'));
} else {
  globalFunc::inlineStatementError(T_('Unavailable'));
}

